package com.laiketui.app.controller.material;

import com.laiketui.common.api.material.MaterialService;
import com.laiketui.core.domain.Result;
import com.laiketui.domain.vo.MainVo;
import com.laiketui.domain.vo.material.MaterialVo;
import com.laiketui.root.annotation.HttpApiMethod;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MaterialController {

    @Autowired
    private MaterialService materialService;

    @ApiOperation("查询材质顶级分类数据列表")
    @RequestMapping("/selectTopLevelList")
    @HttpApiMethod(apiKey = "app.material.selectTopLevelList")
    public Result selectTopLevelList(MainVo vo){
        return Result.success(materialService.topLevelMaterialList(vo));
    }

    @ApiOperation("查询材质分类数据列表")
    @RequestMapping("/getMaterialList")
    @HttpApiMethod(apiKey = "app.material.getMaterialList")
    public Result getMaterialList(MaterialVo vo){
        return Result.success(materialService.getMaterialList(vo,null));
    }

}
